package cn.hzking.gjmall.adpters.home;

import android.app.Activity;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.hzking.gjmall.R;
import cn.hzking.gjmall.bean.HomeDataBean;
import cn.hzking.gjmall.utils.UriMatch;

/**主页商品分类名称
 * Created by Administrator on 2018/2/7.
 */

public class HeadLineAdpter extends BaseQuickAdapter<HomeDataBean.DataBean.HeadlineBean,BaseViewHolder> {
    public HeadLineAdpter(int layoutResId, @Nullable List<HomeDataBean.DataBean.HeadlineBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(final BaseViewHolder baseViewHolder, final HomeDataBean.DataBean.HeadlineBean headlineBean) {
        baseViewHolder.setText(R.id.header_one_list_text,headlineBean.getName());
        baseViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //todo headline点击事件处理
                new UriMatch((Activity) mContext,headlineBean.getUrl()).match();
            }
        });

    }
}
